export default function () {
  const routerFn = (fullPath: any) => {
    const route = useRoute()
    const localeRoute = useLocaleRoute()
    const store = useStateStore()
    // 你的公共逻辑
    let arr  = ['cn','en']

    let a = arr.filter((m) => fullPath.includes(m))

    if(a.length){
      let paths = fullPath.split(a[0])
      fullPath = '/'+store.locale +paths[1]
    } else {
      fullPath = '/'+store.locale +fullPath
    }
  
     // 用于把当前页面生成对应的语言前缀的路由,例如:/zh/,/zh/about
     const routePath = localeRoute({ path:fullPath, query: { ...route.query } })
  
    if (routePath) {
      return navigateTo(fullPath)  // 路由跳转
    }
  };
 
  return {
    routerFn
  };
}